/*
 * @Author: 谢陈洁
 * @Date: 2025-07-07 13:19:33
 * @LastEditors: 谢陈洁
 * @LastEditTime: 2025-07-30 15:18:08
 * @Description: file content
 */
export const columns = [
  { prop: 'title', label: '名称', width: 200 },
  { prop: 'categoryName', label: '分类', width: 200,
    render:(row:any) =>{
      return row.linkGroup.name
    }
   },
  { prop: 'icon_url', label: '图标', width: 100,
    type: 'image', align: 'center'
   },
  { prop: 'description', label: '描述' },
  { label: '操作', width: 200, slot: 'action', fixed: 'right' }
]

export const formConfig = [
  {
    label: '名称',
    prop: 'title',
    span: 24,
    rules: [{ required: true, message: '请输入名称' }]
  },
  {
    label: '链接',
    prop: 'url',
    span: 24,
    rules: [{ required: true, message: '请输入URL' }]
  },
  // {
  //   label: '图标',
  //   prop: 'icon_url',
  //   span: 24,
  //   type: 'icon-selector'
  // },
  {
    label: '上传封面',
    prop: 'icon_url',
    value: [],
    type: 'upload',
    span: 24,
    placeholder: '请上传封面图片，格式为jpg、png、gif',
    attrs: {
      type: 'image/*',
      maxSize: 1024 * 1024 * 5,
      multiple: false,
      limit: 1,
      tips: '请上传封面图片，格式为jpg、png、gif'
    }
  },
  // {
  //   label: '图标',
  //   prop: 'icon_url',
  //   span: 24,
  //   type: 'upload',
  //   attrs: {
  //     accept: 'image/*',
  //     multiple: false,
  //     limit: 1
  //   }
  // },
  {
    label: '描述',
    prop: 'description',
    span: 24,
    attrs: {
      type: 'textarea',
      rows: 4
    },
    rules: [{ required: true, message: '请输入描述' }]
  },
  {
    label: '分类',
    prop: 'category_id',
    span: 24,
    type: 'select',
    rules: [{ required: true, message: '请选择分类' }]
  },
  {
    label: '排序',
    prop: 'sort',
    span: 24,
    type: 'input',
    attrs: {
      type: 'number'
    }
  }
]

export const searchConfig = [
  {
    label: '名称',
    prop: 'title',
    span: 8,
    type: 'input'
  },
  {
    label: '分类',
    prop: 'category_id',
    span: 8,
    type: 'select',
    config: {
      style: { width: '160px' }
    }
  }
]
